import Vue from "vue";
import VueRouter from "vue-router";
import HmNew from "@/views/HmNew.vue";
import HmRecommend from "@/views/HmRecommend.vue";
import HmLayout from "@/views/HmLayout.vue";

// import HmDetail from "@/views/HmDetail.vue";
// import HmRegister from "@/views/HmRegister.vue";
// import HmLogin from "@/views/HmLogin.vue";
// import HmArticle from "@/views/HmArticle.vue";
// import HmCollect from "@/views/HmCollect.vue";
// import HmLike from "@/views/HmLike.vue";
// import HmMy from "@/views/HmMy.vue";
const HmDetail = () => import("@/views/HmDetail.vue");
const HmRegister = () => import("@/views/HmRegister.vue");
const HmLogin = () => import("@/views/HmLogin.vue");
const HmArticle = () => import("@/views/HmArticle.vue");
const HmCollect = () => import("@/views/HmCollect.vue");
const HmLike = () => import("@/views/HmLike.vue");
const HmMy = () => import("@/views/HmMy.vue");

Vue.use(VueRouter);
const router = new VueRouter({
  routes: [
    {
      path: "/",
      redirect: "/layout/article/recommend",
    },
    {
      path: "/login",
      component: HmLogin,
    },
    {
      path: "/register",
      component: HmRegister,
    },
    {
      path: "/detail/:id",
      component: HmDetail,
    },
    {
      path: "/layout",
      component: HmLayout,
      children: [
        {
          path: "/layout/article",
          component: HmArticle,
          children: [
            {
              path: "/layout/article/recommend",
              component: HmRecommend,
            },
            {
              path: "/layout/article/new",
              component: HmNew,
            },
          ],
        },
        {
          path: "/layout/collect",
          component: HmCollect,
        },
        {
          path: "/layout/like",
          component: HmLike,
        },
        {
          path: "/layout/my",
          component: HmMy,
        },
      ],
    },
  ],
  linkActiveClass: "active",
  linkExactActiveClass: "ex-active",
});
export default router;
